const install = (Vue) => {
	let apis = {
		/*
		 *  微信jssdk配置接口
		 */
		// 配置接口
		setWxJsSdk(data = {}){
			return Vue.prototype.$u.post('/scanCode', data)
		},
		/*
		 *  登录相关接口
		 */
		// 配送端公众号登录
		wxH5Login(data = {}){
			return Vue.prototype.$u.post('/deliveryInfo/loginDeliveryInfoOfficial', data)
		},
		// 注册配送员
		registerDeliveryInfo(data = {}){
			return Vue.prototype.$u.post('/deliveryInfo/registerDeliveryInfo', data)
		},
		// 配送员登录
		loginDeliveryInfo(data = {}){
			return Vue.prototype.$u.post('/deliveryInfo/loginDeliveryInfo', data)
		},
		// 配送员退出登录
		loginOutDeliveryInfo(data = {}){
			return Vue.prototype.$u.post('/deliveryInfo/exitDeliveryInfo', data)
		},
		// 配送员修改密码
		updateDeliveryInfoPassword(data = {}){
			return Vue.prototype.$u.post('/deliveryInfo/updateDeliveryInfoPassword', data)
		},
		// 修改配送员
		updateDeliveryInfo(data = {}){
			return Vue.prototype.$u.post('/deliveryInfo/updateDeliveryInfo', data)
		},
		/*
		 *  首页相关
		 */
		// 获取广告
		getBanner(data = {}){
			return Vue.prototype.$u.get('/getBanner', data)
		},
		getDeliveryInfo(data = {}){
			return Vue.prototype.$u.post('/deliveryInfo/getDeliveryInfo', data)
		},

		// 获取校园
		getComSchool(data = {}){
			return Vue.prototype.$u.post('/comSchool/getComSchool', data)
		},
		// 添加配送员审核
		addDeliveryExamine(data = {}){
			return Vue.prototype.$u.post('/deliveryExamine/addDeliveryExamine', data)
		},
		// 获取订单
		getOrderTakeaway(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/getOrderTakeaway', data)
		},
		// 获取外卖订单（配送员）后面三个
		getOrderTakeawayToDelivery(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/getOrderTakeawayToDelivery', data)
		},
		// 获取外卖订单（配送员）
		getOrderTakeawayHallToDelivery(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/getOrderTakeawayHallToDelivery', data)
		},
		//配送员抢单
		robOrderTakeawayToDelivery(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/robOrderTakeawayToDelivery', data)
		},
		// 配送员取餐
		takeOrderTakeawayToDelivery(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/takeOrderTakeawayToDelivery', data)
		},
		//配送员确认完成
		okOrderTakeawayToDelivery(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/okOrderTakeawayToDelivery ', data)
		},
		// 配送员中转订单
		transferOrderTakeawayToDelivery(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/transferOrderTakeawayToDelivery ', data)
		},
		//获取外卖订单
		getOrderTakeaway(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/getOrderTakeaway', data)
		},
		//配送员审核记录
		getDeliveryExamine(data = {}){
			return Vue.prototype.$u.post('/deliveryExamine/getDeliveryExamine', data)
		},
		//获取今日抢单
		getDayRobOrder(data = {}){
			return Vue.prototype.$u.post('/reportFormsDelivery/getDayRobOrder', data)
		},
		//获取累计抢单
		getAllRobOrder(data = {}){
			return Vue.prototype.$u.post('/reportFormsDelivery/getAllRobOrder', data)
		},
		//获取我的余额
		getDayRobOrderBalance(data = {}){
			return Vue.prototype.$u.post('/reportFormsDelivery/getDayRobOrderBalance', data)
		},
		//获取二维码
		transferOrderTakeawayCode(data = {}){
			return Vue.prototype.$u.post('/orderTakeaway/transferOrderTakeawayCode', data)
		},
		/*
		 *  提现相关
		 */
		// 获取微信转账流水
		getComWithdrawalFlow(data = {}){   
			return Vue.prototype.$u.post('/comWithdrawalFlow/getComWithdrawalFlow', data)
		},
		// 获取微信转账规则
		getComWithdrawalFlowRule(data = {}){   
			return Vue.prototype.$u.post('/comWithdrawalFlow/getComWithdrawalFlowRule', data)
		},
		// 添加微信转账流水
		// type   类型（0：用户转账；1：配送员转账；2：店铺转账）
		// userId   用户ID
		// deliveryId   配送员ID
		// shopId   店铺ID
		// total   金额
		// allTotal   总提现金额
		// withdrawalFees   提现手续费
		addComWithdrawalFlow(data = {}){   
			return Vue.prototype.$u.post('/comWithdrawalFlow/addComWithdrawalFlow', data)
		},
		// 获取配送员可提现余额和累计提现 id
		getShopComWithdrawalFlowRule(data = {}){   
			return Vue.prototype.$u.post('/reportFormsDelivery/getWithdrawalBalance', data)
		},
		// 获取即将到账和累计到账 id
		getReceived(data = {}){   
			return Vue.prototype.$u.post('/reportFormsDelivery/getReceived', data)
		},
		// 获取收入明细 id: 店铺id incomeType 获取收入明细类型 (0: 本月收入;1: 今日收入;2:昨日收入)
		getIncome(data = {}){   
			return Vue.prototype.$u.post('/reportFormsDelivery/getIncome', data)
		},
	}
	Vue.prototype.$u.api = {...apis};
}

export default {
	install
}